package com.example.produces.service.impl;

import com.example.produces.entity.Plan;
import com.example.produces.mapper.PlanMapper;
import com.example.produces.service.PlanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
@Service
@Transactional
public class PlanImpl implements PlanService {
    @Autowired
    private PlanMapper planMapper;
    @Override
    public List<Plan> findAll() {
        List<Plan> plan=planMapper.findAll();
        return plan;
    }

    @Override
    public void add(Plan plan) {
        planMapper.add(plan);

    }

    @Override
    public Plan findOne(String name) {

        return planMapper.findOne(name);
    }

    @Override
    public void upDate(Plan plan) {
    planMapper.upDate(plan);
    }

    @Override
    public void delete(String name) {
     planMapper.delete(name);
    }
}
